/*
 * サンプル (boss.c)
 */
#include "spec.h"
#include "vardecl.h"
#include "service.h"
/*
 * #define BOSS_PATTERN1 を #undef BOSS_PATTERN1 にすると
 * 違う行動パターンになります。
 */

#define BOSS_PATTERN1 

/* 
========================================
  ボス動作関数
========================================
*/
void
BossMain(int which)
{
  int i, cnt;

  for (cnt = 0, i = 0; i < CORE_MAX; i++)
    if (destroy[i] == FALSE)
      cnt++;
#ifdef BOSS_PATTERN1
  if (cnt > 2) {
    Machine[which].direct += 10;
    Machine[which].direct %= 3600;
  }
#else
  if ((cnt & 1) == 0) {
    Machine[which].direct += 10;
    Machine[which].direct %= 3600;
  } else {
    Machine[which].direct -= 10;
    if (Machine[which].direct < 0)
      Machine[which].direct += 3600;
  }
#endif
}
